package com.itheima.controller;

import com.itheima.mapper.EmpMapper;
import com.itheima.pojo.ClazzCount;
import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("")
public class ReportController {

    @Autowired
    private ReportService reportService;

//     1,员工性别统计
    @GetMapping("/report/empGenderData")
    public Result getEmpGenderData(){
        List<HashMap<String,Object>> list= reportService.getEmpGenderData();
        return Result.success(list);
    }
//     员工职位统计：

    @GetMapping("/report/empJobData")
    public Result getEmpJobData(){
       JobOption jobOption= reportService.getEmpJobData();

        return Result.success(jobOption);
    }

//     ：/report/studentCountData
//     班级人数统计

    @GetMapping("/report/studentCountData")
    public Result getClazzCount(){
      ClazzCount clazzCount = reportService.getClazzCount();
       return Result.success(clazzCount);

    }

    // 学院学历 report/studentDegreeData

    @GetMapping("/report/studentDegreeData")
    public Result getStudentDegreeData(){


      List<Map>  list=  reportService.getStudentDegreeData();

      return  Result.success(list);
    }
}
